{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "8ecf809b",
   "metadata": {},
   "source": [
    "### 图像处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "5ab8e779",
   "metadata": {},
   "outputs": [],
   "source": [
    "import cv2\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "def plt_show(name, img):\n",
    "    if(len(img.shape) == 3) :\n",
    "        img2 = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)\n",
    "        plt.title(name)\n",
    "        plt.imshow(img2)\n",
    "    elif (len(img.shape) == 2) :\n",
    "        plt.title(name)\n",
    "        plt.imshow(img, cmap='gray')\n",
    "    else:\n",
    "        print('some error im plt_show')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8076fe23",
   "metadata": {},
   "source": [
    "#### 图像域值\n",
    "\n",
    "**`ret, dst = cv2.threshold(src, thresh, maxval, type)`**\n",
    "\n",
    "- src: 输入图，只能输入单通道图像，通常来说为灰度图\n",
    "- dst: 输出图\n",
    "- thresh: 域值\n",
    "- maxval: 当像素值超过了域值（或者小于域值，根据type来决定）所赋予的值\n",
    "- type: 二值化操作的类型，包含了以下5种类型：cv2.THRESH_BINARY; cv2.THRESH_BINARY_INV; cv2.THRESH_TRUNC; cv2.THRESH_TOZERO; cv2.THRESH_TOZERO_INV\n",
    "\n",
    "* `cv2.THRESH_BINARY`: \n",
    "* `cv2.THRESH_BINARY_INV`: \n",
    "* `cv2.THRESH_TRUNC`: \n",
    "* `cv2.THRESH_TOZERO`: \n",
    "* `cv2.THRESH_TOZERO_INV`: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "abee8f11",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "2c755bea",
   "metadata": {},
   "source": [
    "#### 形态学-腐蚀操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "231a43b8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image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dr0YgIuAN6KezwHmeFmmFixLb2Bz1PMdQFfncVecK6SBBcC0+uZLlQF4hXCf72m3jEBb4BPgAsJX1GY542u2VeAN4CLncZYzn3hd9kaWqzvhHcJ4YAXhbrNdXT6vm1HdgL1Rz/c549JBF1U94DwuAbo4j1N6mZ0q9beBD0mjZXSaGOuBQ8BbwG7ghKpWO7NEL0PN8jnTTwIdXS1w0/0f4F4g8kvJjri8fF6HTUbQ8C4i5a8xEJE84EXgblUtjZ6W6suoqkFVHUK4BjASGOBtiVqPiFwDHFLVj70sh9dhUwz0iHre3RmXDg6KSFcA5+8hZ3xKLrOIBAgHzWJVXeaMTqtlBFDVE8C7hJsVHUQk8vvB6GWoWT5nenvgqLslbZKLgWtF5HPgBcJNqcdwefm8DpuPgL7OUfFsYCqw3OMytZblwK3O41sJH+eIjL/FOWNzIXAyqimSlCR8z4ungG2q+puoSWmxjCLSWUQ6OI9zCR+P2kY4dKY4s9VdvshyTwHecWp2SUlV56hqd1XtTfg79o6q3oTby5cEB66uAnYSbiPf73V5mrkMzwMHgCrCbd/phNu4q4G/A28DBc68QvgM3G5gEzDc6/LHsXyjCTeRNgLrneGqdFlG4HzgU2f5NgM/d8b/E7AO2AX8Gchxxrdxnu9ypv+T18vQhGUdC6zwYvns5wrGGFd43YwyxmQICxtjjCssbIwxrrCwMca4wsLGGOMKCxtjjCssbIwxrvj/73fH1e1HEcsAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "img = cv2.imread('pie.png', 0)\n",
    "plt_show('pie', img)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "36725172",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARsAAAEICAYAAABvb1AUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwga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CAC/UNX+wDDgLud7SpV1PAl8T1UHAoOAUc7Q0Y8CT6jq/wAOAbc6y98KHHKmP+EslwymABujnru7fqrqWQGGA4uink8DpnlZp2asSz5QFPW8GMhzHucRPnER4DlgYm3LJUsB3iY85nvKrSOQDawGLiJ8Rq3fmV61rQKLgOHOY7+znHhd93rW6wzC/xC+B7xDeNhsV9fP625UD2B71PMdzrRUkKuqu53He4Bc53FSr7PTpL4AWEYKraPTxVgL7AM+ALYCh1U14CwSvQ5V6+fMPwJ0cbXCjTcDuA8IOc+74PL6eR02rYKG/0Uk/TkGItIOeBO4R1WPRs9L9nVU1aCqDiLcAhgK9PW2Ri1HRK4C9qnqKi/r4XXY7ATOjHp+hjMtFewVkTwA5+c+Z3pSrrOIpBMOmldV9S1nckqtI4CqHgY+Ityt6CQikesHo9ehav2c+R2BA+7WtFH+HRgrIl8DrxPuSj2Jy+vnddisAHo7e8UzgAnAfI/r1FLmAzc7j28mvJ8jMv0m54jNMOBIVFckIUn4PgQvABtV9Y9Rs1JiHUWkm4h0ch63Ibw/aiPh0PmRs1jN9Yus94+AD52WXUJS1Wmqeoaq5hP+G/tQVW/A7fVLgB1XVwCbCPeRf+V1fZq4Dq8Bu4FKwn3fWwn3cRcDm4F/ADnOskL4CNxWoBAY4nX9G7B+BYS7SOuBtU65IlXWETgfWOOsXxHwG2d6L2A5sAWYA2Q607Oc51uc+b28XodGrOsI4B0v1s8uVzDGuMLrbpQxppWwsDHGuMLCxhjjCgsbY4wrLGyMMa6wsDHGuMLCxhjjiv8P6cuVio8UNiYAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "kernel = np.ones((5,5), np.uint8)\n",
    "erosion = cv2.erode(img, kernel, iterations = 1)\n",
    "plt_show('erosion', erosion)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "1933a3c2",
   "metadata": {},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lIb+fVzF3OuoQgIuMJT2ver6rVEZveAh5yrmIaDFwPbCVeuefWSYmIkwn3EL7i5CDwQ7fb04b2FhF+GbkH2OXUPYTnNt8HDgAlQJazvwC/cfpXChS43Ycr9O0O/nG1TL7zRCwDVgFdnfXdnNtlzvZ8t9vdTD9GAdudMXqT8BUWSTk+wP8B9gEfAy8TvvIiacYGWEn4fEEd4VdV3+3IWBCeyy5z6jsJ1p8ywnPoDXnwYsT+P3T6sx+YELE+5rln71A1xhgPcntaxhhjTAxYuBtjjAdZuBtjjAdZuBtjjAdZuBtjjAdZuBtjjAdZuBtjjAdZuBtjjAf9f+4/euZWOw01AAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "kernel = np.ones((30,30), np.uint8)\n",
    "erosion_1 = cv2.erode(img, kernel, iterations = 1)\n",
    "erosion_2 = cv2.erode(img, kernel, iterations = 2)\n",
    "erosion_3 = cv2.erode(img, kernel, iterations = 3)\n",
    "\n",
    "res = np.hstack((erosion_1, erosion_2, erosion_3))\n",
    "plt_show('res', res)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "59f33130",
   "metadata": {},
   "source": [
    "#### 形态学-膨胀操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "c1b70429",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARsAAAEICAYAAABvb1AUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAhQklEQVR4nO3de3RU9d3v8fd3JhOSABIuKYQCAnIpKSrtk6C0KIJQI7YFXbaFHloeL7BUuqxaz1GOXX10PdYefFZFe1AEpcfqoxXRKggVBRG1VuVSLhoRQUUIFy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ng1MAZZ5XKf2sgyY7tyeTmQ7R/30Xzp7bM4HjkatiiQliVz7YxGwTVXvi5qVFm0UkQIRyXdu5xLZHrWNSOhc6Sx2avvq230lsMbp2SUlVZ2tqn1UtT+R39gaVf0fuN2+JNhwNRH4iMg68h1e16eNbfgrsB+oI7Luew2RddxXgR3AaqCbs6wQ2QP3MfAeUOx1/WNo32giq0hbgc1OmZgubQTOATY57Xsf+J0zfSCwDtgJLAE6ONNznPs7nfkDvW5DK9p6EbDci/bZ6QrGGFd4vRpljMkQFjbGGFdY2BhjXGFhY4xxhYWNMcYVFjbGGFdY2BhjXPH/AWPc66XnqLB4AAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "kernel = np.ones((5,5), np.uint8)\n",
    "pie_dilate = cv2.dilate(img, kernel, iterations = 1)\n",
    "plt_show('erosion', pie_dilate)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "518b872e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAACTCAYAAAB1YlneAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgB0lEQVR4nO2deXQUVdr/v093J52FmH2SAIEEZBkGEZCBoA4wP8QVXswcF3JGRX8i6jvjyLwzjPJ6ZlzOwXXGgwuiDPpTnDCMr+OMMC6AEnVeEDAsBiIBgkgWQhayQtJJL8/vj67WBhO6k3T1reo8n3PuSdWtStVz71P17Xufe6uKmBmCIAhCZGFRbYAgCIIQekTcBUEQIhARd0EQhAhExF0QBCECEXEXBEGIQETcBUEQIhARd0EQhAhExF0QBCECEXEXBA0isqm2QRBChYi7MKAhom+I6AEiKgFwhoguJ6LtR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23s/Tk2xTQkIpoLoI6Zd6u2JUTY4O02r2LmSQDOwNv1/xaz+EeLRc+H9wdrMIB4AFcrNSrEmMUXwUBEDwFwAShUbQugXtyrAWT7rQ/V8gwNEUXBK+yFzPyOll1LRFna9iwAdVq+0ct4GYD/IKJvAKyHNzTzHIAkIvK9nsLf5m/Lo21PBHAqnAYHoApAFTPv1NbfhlfszeifKwAcY+Z6ZnYCeAdef5nVNz566wsj+wgAQES3A5gL4OfaDxaguDyqxf0LAKO00f9oeAeBNii26bwQEQF4FcBBZn7Wb9MGAL5R/IXwxuJ9+bdpMwHyALT4dUmVw8zLmHkoM+fAW/9bmfnnAIoA3KDtdm55fOW8QdvfMC0vZj4JoJKIxmhZswF8BXP6pwJAHhHFadedryym9I0fvfXFJgBXElGy1pu5UsszBER0Nbxhzf9g5na/TRsALNBmMeUCGAVgF8Kle6oGJfwGE66Fd8bJUQAPqbYnCHsvh7cbWQJgn5auhTe2+TGAIwA+ApCi7U8AVmrl2w9giuoynKdss/DdbJkR2oVYDuB/ANi1/BhtvVzbPkK13d2UYyKAYs1H/4R3hoUp/QPgUQBlAA4AeBPemRem8Q2Av8I7XuCEt1d1Z198AW8su1xLdxisPOXwxtB9evCy3/4PaeU5BOAav3zddU+eUBUEQYhAVIdlBEEQBB0QcRcEQYhARNwFQRAiEBF3QRCECETEXRAEIQIRcRcEQYhARNwFQRAiEBF3QRCECOT/AyY/MncB5NHQAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "kernel = np.ones((30,30), np.uint8)\n",
    "dilate_1 = cv2.dilate(img, kernel, iterations = 1)\n",
    "dilate_2 = cv2.dilate(img, kernel, iterations = 2)\n",
    "dilate_3 = cv2.dilate(img, kernel, iterations = 3)\n",
    "\n",
    "res = np.hstack((dilate_1, dilate_2, dilate_3))\n",
    "plt_show('res', res)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ce5b4fcf",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.1rc1 ('env': venv)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1rc1"
  },
  "vscode": {
   "interpreter": {
    "hash": "930a6bc004e1094f26a91242998a4a8b7e96d1fca357746a1752f130ef60b75e"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
